home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI1217.ASC
< prev
next >
Wrap
Text File
|
1993-01-05
|
6KB
|
199 lines
PRODUCT : Paradox NUMBER : 1217
VERSION : 4.0
OS : DOS
DATE : January 5, 1993 PAGE : 1/3
TITLE : Accepting input for queries in the Application
Workshop
Intended Audience:
This Technical Information sheet is intended for someone with a
moderate level of Paradox and Application Workshop knowledge.
Prerequisites:
A basic understanding of Paradox and the Application Workshop.
This Technical Information sheet explains some basic methods to
accept input from someone for a query from within a Workshop
application. This might be necessary when the criteria for a
query will not always be the same each time it is run.
The following script can be used:
1. in a MultiAction object as a PLAY A SCRIPT object or
2. used as a procedure (PROC(EXECPROC) in a MultiAction
object) which is:
a. written to a library and
b. specified in the Autolib box under Application |
Edit
Subsequent steps in the MultiAction would most commonly be Query
objects. It should be noted that if the accept script is in
procedure form and being called from a library, it can also be
defined in the Setup Proc box from within the Query object
definition.
Please note that comments following a semicolon are ignored by
both Paradox and the Workshop.
Example 1) As a script:
WINDOW CREATE FLOATING TO WINAME
WINDOW RESIZE WINAME TO 7,30 ;makes the window smaller
@ 3,5 ?? "ENTER SOMETHING: " ;prompt for input
ACCEPT "A10" TO TILDVAR ;variable type and
;variable name
WINDOW CLOSE ;close the window after
;input
PRODUCT : Paradox NUMBER : 1217
VERSION : 4.0
OS : DOS
DATE : January 5, 1993 PAGE : 2/3
TITLE : Accepting input for queries in the Application
Workshop
Example 2) As a procedure:
CREATELIB "LIBNAME" ;Creates a library file
PROC INPUTPROC() ;Specify the beginning of
;a procedure
WINDOW CREATE FLOATING TO WINAME ;Same as example 1
same as Example 1 above. ;Duplicate the lines from
;example 1 above
ENDPROC ;Specify the end of a
;procedure
WRITELIB "LIBNAME" INPUTPROC ;Write/store the
;procedure in
;the library file
Play example 2 to create a library file and write the procedure
to it.
The following are some common pitfalls that you will want to
avoid and some suggestions if you are new to the Paradox
Application Language:
1. It is usually best to keep both script and library files
in the same directory as your application.
2. Window names (or handles), (WINAME in this example), must
be consistent from CREATE to CLOSE.
3. The window size, 7,30 (height, width) in this example, can
be changed to fit your prompt and variable type.
4. Variable types must match the field (use Tools | Info |
Structure for the table being queried to determine the
field types.) Possible problems may be an empty Answer
table or the message "Expression in this field has the
wrong type" when the query is run.
5. Variable names, TILDVAR in this example, are used as tilde
variables in Query objects and must be unique if more than
one is used in the same query (For information on the use
of tilde variables, refer to please see Chapter 19 of the
PAL Programmer's Guide.)
PRODUCT : Paradox NUMBER : 1217
VERSION : 4.0
OS : DOS
DATE : January 5, 1993 PAGE : 3/3
TITLE : Accepting input for queries in the Application
Workshop
6. It is not possible to include query wildcard characters in
the accept variable. For example, TILDVAR cannot be equal
to "..Smith.." because the query will look for all records
that have string ..Smith.. in them. Wildcard characters
(if used) should precede the tilde symbol and/or follow
the tilde variable in the query image. For example, if
TILDVAR were equal to "Smith" then the following query:
TEST═╦════NAME══════╗
║ ..~TILDVAR.. ║
would look for anything in the field NAME that had the
word "Smith" in it. Note that a checkmark has been
omitted for clarity.
Additional references:
Chapter(s) 6,11,12 Pal Programmer's Guide
12 Application Workshop Guide
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.